package atom;

import java.util.concurrent.locks.ReentrantLock;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-10-24
 * Time: 20:23
 */

public class Demo3 {
    public static void main(String[] args) {
        ReentrantLock locker = new ReentrantLock(); //构造方法 true 和 false 公平锁和非公平锁

        //加锁
        locker.lock();

        //容易出现死锁

        //解锁
        locker.unlock();

    }
}
